/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.bishe.service;

import java.util.Date;
import java.util.List;

import com.thinkgem.jeesite.modules.sys.entity.User;
import com.thinkgem.jeesite.modules.sys.utils.UserUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.service.CrudService;
import com.thinkgem.jeesite.modules.bishe.entity.BisheOrder;
import com.thinkgem.jeesite.modules.bishe.dao.BisheOrderDao;

/**
 * 订单管理Service
 * @author yue
 * @version 2018-12-26
 */
@Service
@Transactional(readOnly = true)
public class BisheOrderService extends CrudService<BisheOrderDao, BisheOrder> {

	
	public BisheOrder get(String id) {
		BisheOrder bisheOrder = super.get(id);
		return bisheOrder;
	}
	
	public List<BisheOrder> findList(BisheOrder bisheOrder) {
		return super.findList(bisheOrder);
	}
	
	public Page<BisheOrder> findPage(Page<BisheOrder> page, BisheOrder bisheOrder) {
		return super.findPage(page, bisheOrder);
	}
	
	@Transactional(readOnly = false)
	public void save(BisheOrder bisheOrder) {
		super.save(bisheOrder);
	}



	@Transactional(readOnly = false)
	public void save2(BisheOrder entity) {
		User user = UserUtils.getUser();
		if (StringUtils.isNotBlank(user.getId())){
			entity.setCreateBy(user);
			entity.setUpdateBy(user);
			entity.setCreateDate(new Date());
			entity.setUpdateDate(new Date());
		}
		dao.insert(entity);
	}

	@Transactional(readOnly = false)
	public void delete(BisheOrder bisheOrder) {
		super.delete(bisheOrder);
	}
	
}